﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/Home.Master" AutoEventWireup="true" CodeBehind="ProductDetail.aspx.cs" Inherits="TTMarketing.Admin.ProductDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHeader" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceMain" runat="server">
<asp:Panel ID="plContent" runat="server">
        <div id="close">
            <table width="100%">
                <tr>
                    <td>
                        <asp:Label ID="lblTitle" runat="server" Style="font-size: 30px" 
                            Text="Thông tin mở rộng của sản phẩm"></asp:Label>
                    </td>
                    <td align="right" width="100px">
                        <asp:Label ID="lblStt" runat="server" Text="Trạng thái "></asp:Label>
                        <telerik:RadComboBox ID="cmbClose" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cmbClose_SelectedIndexChanged"
                            Width="100px">
                            <Items>
                                <telerik:RadComboBoxItem runat="server" Text="Open" Value="1" />
                                <telerik:RadComboBoxItem runat="server" Text="Close" Value="0" />
                            </Items>
                        </telerik:RadComboBox>
                    </td>
                </tr>
            </table>
        </div>
        <div id="divmessage2" runat="server">
        </div>
        <asp:Panel ID="plDetail" runat="server" Width="100%">
        <div id="divmessage" runat="server">
            </div>
            <fieldset>
                <legend>Thông tin mở rộng của sản phẩm xuất</legend>
                <table width="100%">
                    <tr>
                        <td width="200px">
                            <asp:Label ID="lblFactoryName" runat="server" Text="Tên sản phẩm"></asp:Label>
                            <asp:ObjectDataSource ID="odsProduct" runat="server" SelectMethod="getById" 
                                TypeName="TTBusiness.ClassDB.clsBSProduct">
                                <SelectParameters>
                                    <asp:QueryStringParameter Name="id" QueryStringField="id" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cmbProduct" runat="server" AutoPostBack="True" DataSourceID="odsProduct"
                                DataTextField="Name" DataValueField="ID" Width="100%" Enabled="False" 
                                ondatabound="cmbProduct_DataBound" 
                                onselectedindexchanged="cmbProduct_SelectedIndexChanged">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblOrderRequest" runat="server" Text="Tên thông tin mở rộng"></asp:Label>
                            <asp:ObjectDataSource ID="odsDetail" runat="server" SelectMethod="getDetailByID"
                                TypeName="TTBusiness.ClassDB.clsBSCateDetail">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="hfId" Name="catedetailId" 
                                        PropertyName="Value" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cmbDetail" runat="server" Width="100%" DataSourceID="odsDetail"
                                DataTextField="Name" DataValueField="ID" Enabled="False">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblOrderRequest0" runat="server" Text="Nội dung"></asp:Label>
                        </td>
                        <td>
                            <telerik:RadEditor ID="txtDetail" runat="server" Width="100%">
                                <Content>
                                
</Content>
                                <ImageManager DeletePaths="~/Image/Editor/Img" MaxUploadFileSize="2048000" 
                                    UploadPaths="~/Image/Editor/Img" ViewPaths="~/Image/Editor/Img" />
                                <DocumentManager DeletePaths="~/Image/Editor/Document" 
                                    MaxUploadFileSize="2048000" UploadPaths="~/Image/Editor/Document" 
                                    ViewPaths="~/Image/Editor/Document" />
                                <FlashManager DeletePaths="~/Image/Editor/Flash" MaxUploadFileSize="2048000" 
                                    UploadPaths="~/Image/Editor/Flash" ViewPaths="~/Image/Editor/Flash" />
                                <SilverlightManager DeletePaths="~/Image/Editor/Siverlight" 
                                    MaxUploadFileSize="2048000" UploadPaths="~/Image/Editor/Siverlight" 
                                    ViewPaths="~/Image/Editor/Siverlight" />
                                <MediaManager DeletePaths="~/Image/Editor/Media" MaxUploadFileSize="2048000" 
                                    UploadPaths="~/Image/Editor/Media" ViewPaths="~/Image/Editor/Media" />
                                <TemplateManager DeletePaths="~/Image/Editor/Template" 
                                    MaxUploadFileSize="2048000" UploadPaths="~/Image/Editor/Template" 
                                    ViewPaths="~/Image/Editor/Template" />
                            </telerik:RadEditor>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btnSave" runat="server" Text="Thêm" onclick="btnSave_Click" />
                            &nbsp;
                            <asp:Button ID="btnClear" runat="server" Text="Reset" 
                                onclick="btnClear_Click" />
                        </td>
                    </tr>
                </table>
                <br />
                <asp:HiddenField ID="hfId" runat="server" />
                <br />
            </fieldset>
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" Width="100%">
            <telerik:RadGrid ID="rgdGrid" runat="server" AllowPaging="True" AllowSorting="True"
                DataSourceID="odsProductDetail" GridLines="None" ShowFooter="True" 
                onselectedindexchanged="rgdGrid_SelectedIndexChanged">
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" 
                    EnablePostBackOnRowClick="True" EnableRowHoverStyle="True">
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <MasterTableView AutoGenerateColumns="False" DataSourceID="odsProductDetail">
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="Mã" 
                            SortExpression="ID" UniqueName="ID">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Name" HeaderText="Tên thông tin mở rộng" 
                            SortExpression="Name" UniqueName="Name">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Number" DataType="System.Int32" 
                            HeaderText="Sô hiệu" SortExpression="Number" UniqueName="Number">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <HeaderContextMenu EnableAutoScroll="True">
                </HeaderContextMenu>
            </telerik:RadGrid>
            <asp:ObjectDataSource ID="odsProductDetail" runat="server" 
                SelectMethod="getByProductId" 
                TypeName="TTBusiness.ClassDB.clsBSCateDetail">
                <SelectParameters>
                    <asp:ControlParameter ControlID="cmbProduct" Name="productid" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </asp:Panel>
    </asp:Panel>
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" 
        EnableHistory="True">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnSaveNew">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divmessage2" />
                    <telerik:AjaxUpdatedControl ControlID="rgdGrid" />
                    <telerik:AjaxUpdatedControl ControlID="plDetail" LoadingPanelID="Loading" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divmessage2"  />
                    <telerik:AjaxUpdatedControl ControlID="rgdGrid"  />
                    <telerik:AjaxUpdatedControl ControlID="plDetail" LoadingPanelID="Loading" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgdGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="cmbClose" />
                    <telerik:AjaxUpdatedControl ControlID="divmessage2"  />
                    <telerik:AjaxUpdatedControl ControlID="plDetail" LoadingPanelID="Loading" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnReset">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divmessage2" />
                    <telerik:AjaxUpdatedControl ControlID="rgdGrid" />
                    <telerik:AjaxUpdatedControl ControlID="plDetail" LoadingPanelID="Loading" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnClear">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divmessage2"  />
                    <telerik:AjaxUpdatedControl ControlID="plDetail" LoadingPanelID="Loading" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmbClose">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divmessage2"  />
                    <telerik:AjaxUpdatedControl ControlID="plDetail" LoadingPanelID="Loading" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmbProduct">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divmessage2"  />
                    <telerik:AjaxUpdatedControl ControlID="rgdGrid" LoadingPanelID="Loading" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
</asp:Content>
